//
//  JMHomeCloudunView.m
//  NewiOSProject
//
//  Created by JMMac on 24.12.23.
//  Copyright © 2023 范智渊. All rights reserved.
//

#import "JMHomeCloudunView.h"

@implementation JMHomeCloudunView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self = [[UIView alloc]initWithFrame:frame];
        self.backgroundColor = Hex_Str_COLOR(@"#F6F9FE");
        self.cornerRadius = 4;
        
        UIImageView *rightImgV = [[UIImageView alloc]initWithFrame:(CGRectMake(self.width-ScaleW(120), 10, ScaleW(109), ScaleW(93)))];
        rightImgV.image = ImageNamed(@"home_cloundun");
        [self addSubview:rightImgV];

        
        
        UILabel * integralSubTitleLab = [JMControl createLabelWithFrame:CGRectMake(21, 20, self.width-50-rightImgV.width, 44) Font:Font(14) Text:@"Obtener el puntaje que usan los prestamistas  " color:Hex_Str_COLOR(@"#3C57F8")];
        integralSubTitleLab.numberOfLines = 0;
        [self addSubview:integralSubTitleLab];

        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc]initWithString:integralSubTitleLab.text];
        attr.yy_font = [UIFont systemFontOfSize:14];

        UIImageView *detailImgV = [[UIImageView alloc]initWithFrame:(CGRectMake(0, 0, 15, 15))];
        detailImgV.image = ImageNamed(@"home_right");
        NSTextAttachment *yearAttchment00 = [[NSTextAttachment alloc]init];
        yearAttchment00.bounds = CGRectMake(0, 0, 15, 15);
        yearAttchment00.image = detailImgV.image;
        
        NSAttributedString *yearString00 = [NSAttributedString attributedStringWithAttachment:(NSTextAttachment *)(yearAttchment00)];
        [attr insertAttributedString:yearString00 atIndex:attr.length];
        integralSubTitleLab.attributedText = attr;
     
        
        
        UILabel * integralTitleLab = [JMControl createAutoHeightLabelWithOrgin:(CGPointMake(integralSubTitleLab.left, integralSubTitleLab.bottom)) andWidth:integralSubTitleLab.width Font:[UIFont systemFontOfSize:12] Text:@"Conocer su crédito lo ayuda a solicitar préstamos de manera rápida y justa！" color:Hex_Str_COLOR(@"#666666")];
        [self addSubview:integralTitleLab];
        integralTitleLab.numberOfLines = 0;
        
      
        @weakify(self)
        [self tapAction:^(UIView *sender) {
            @strongify(self)
            
            
        }];
    }
    return self;
}

@end
